//获取应用实例
const app = getApp()

Page({

  data: {
    phone: '',
    hiddenmodalput: true,
    //可以通过hidden是否掩藏弹出框的属性，来指定那个弹出框 
    motto: 'Hello World',
    userInfo: {},
    hasUserInfo: false
  },

  livingScene:function () {
    wx.startWifi({
      success: function (res) {
        console.log(res.errMsg)
      }
    })
  },

  onLoad: function () {

    wx.startWifi({
      success: function (res) {
        console.log(res.errMsg)
      }
    }),
      wx.onGetWifiList(function (res) {
        if (res.wifiList.length) {
          wx.setWifiList({
            wifiList: [{
              SSID: res.wifiList[0].SSID,
              BSSID: res.wifiList[0].BSSID,
              password: 'cWfHvj@Gtd89'
            }]
          })
        } else {
          wx.setWifiList({
            wifiList: []
          })
        }
      })
    wx.getWifiList()
    
  }
})
